﻿using _111.Models;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace _111.QywxDocument.WeeklyReport.Model
{
    /// <summary>
    /// 周报详情响应模型
    /// </summary>
    public class WeeklyReportResponse:WXResponse
    {
        /// <summary>
        /// 周报详情信息
        public WeeklyReportInfo info { get; set; }
    }

    /// <summary>
    /// 周报详情信息
    /// </summary>
    public class WeeklyReportInfo
    {
        /// <summary>
        /// 周报唯一标识
        /// </summary>
        public string journal_uuid { get; set; }

        /// <summary>
        /// 模板名称
        /// </summary>
        public string template_name { get; set; }

        /// <summary>
        /// 模板ID
        /// </summary>
        public string template_id { get; set; }

        /// <summary>
        /// 报告时间（时间戳）
        /// </summary>
        public long report_time { get; set; }

        /// <summary>
        /// 提交人信息
        /// </summary>
        public UserInfo submitter { get; set; }

        /// <summary>
        /// 接收人列表
        /// </summary>
        public List<UserInfo> receivers { get; set; }

        /// <summary>
        /// 已读接收人列表
        /// </summary>
        public List<object> readed_receivers { get; set; }

        /// <summary>
        /// 申请数据内容
        /// </summary>
        public ApplyData apply_data { get; set; }

        /// <summary>
        /// 评论列表
        /// </summary>
        public List<object> comments { get; set; }
    }

    /// <summary>
    /// 用户信息（包含userid）
    /// </summary>
    public class UserInfo
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public string userid { get; set; }
    }

    /// <summary>
    /// 申请数据内容
    /// </summary>
    public class ApplyData
    {
        /// <summary>
        /// 内容列表
        /// </summary>
        public List<ContentItem> contents { get; set; }
    }

    /// <summary>
    /// 内容项
    /// </summary>
    public class ContentItem
    {
        /// <summary>
        /// 控件类型
        /// </summary>
        public string control { get; set; }

        /// <summary>
        /// 控件ID
        /// </summary>
        public string id { get; set; }

        /// <summary>
        /// 标题文本列表
        /// </summary>
        public List<TextItem> title { get; set; }

        /// <summary>
        /// 控件值
        /// </summary>
        public ContentValue value { get; set; }
    }

    /// <summary>
    /// 文本项
    /// </summary>
    public class TextItem
    {
        /// <summary>
        /// 文本内容
        /// </summary>
        public string text { get; set; }
    }

    /// <summary>
    /// 内容值
    /// </summary>
    public class ContentValue
    {
        /// <summary>
        /// 提示信息列表
        /// </summary>
        public List<object> tips { get; set; }

        /// <summary>
        /// 成员列表
        /// </summary>
        public List<object> members { get; set; }

        /// <summary>
        /// 部门列表
        /// </summary>
        public List<object> departments { get; set; }

        /// <summary>
        /// 文件列表
        /// </summary>
        public List<object> files { get; set; }

        /// <summary>
        /// 子内容列表
        /// </summary>
        public List<ChildContent> children { get; set; }

        /// <summary>
        /// 统计字段
        /// </summary>
        public List<object> stat_field { get; set; }

        /// <summary>
        /// 文本内容（仅Text类型控件有值）
        /// </summary>
        public string text { get; set; }

        /// <summary>
        /// 选择器配置（仅Selector类型控件有值）
        /// </summary>
        public SelectorConfig selector { get; set; }

        /// <summary>
        /// 汇总字段
        /// </summary>
        public List<object> sum_field { get; set; }

        /// <summary>
        /// 关联审批
        /// </summary>
        public List<object> related_approval { get; set; }

        /// <summary>
        /// 学生列表
        /// </summary>
        public List<object> students { get; set; }

        /// <summary>
        /// 班级列表
        /// </summary>
        public List<object> classes { get; set; }

        /// <summary>
        /// 文档列表
        /// </summary>
        public List<object> docs { get; set; }

        /// <summary>
        /// 微盘文件列表
        /// </summary>
        public List<object> wedrive_files { get; set; }
    }

    /// <summary>
    /// 子内容项
    /// </summary>
    public class ChildContent
    {
        /// <summary>
        /// 子列表项
        /// </summary>
        public List<ContentItem> list { get; set; }
    }

    /// <summary>
    /// 选择器配置
    /// </summary>
    public class SelectorConfig
    {
        /// <summary>
        /// 选择类型（single-单选）
        /// </summary>
        public string type { get; set; }

        /// <summary>
        /// 选项列表
        /// </summary>
        public List<SelectorOption> options { get; set; }

        /// <summary>
        /// 操作关系
        /// </summary>
        public List<object> op_relations { get; set; }
    }

    /// <summary>
    /// 选择器选项
    /// </summary>
    public class SelectorOption
    {
        /// <summary>
        /// 选项键值
        /// </summary>
        public string key { get; set; }

        /// <summary>
        /// 选项值文本
        /// </summary>
        public List<TextItem> value { get; set; }
    }
}